package 其他.检查是否存在满足条件的数字组合;
import java.util.*;
public class Solution {



    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        sc.nextLine();
        String str = sc.nextLine();
        String[] strArr = str.split(" ");
        int index = 0;  //  是否找到, 为0 没有找到
        int[] arr = new int[strArr.length];
        for (int i = 0; i < strArr.length; i++)
            arr[i] = Integer.parseInt(strArr[i]);
        Arrays.sort(arr);
        for (int i = 0; i < arr.length; i++)
            for (int j = 0; j < arr.length; j++)
                for (int k = 0; k < arr.length; k++)
                    if ((arr[i] == arr[j] + 2 * arr[k]) && (i != j && i != k && j != k)) {
                        index++;
                        System.out.println(arr[i] + " " + arr[j] + " " + arr[k]);
                    }
        if (index == 0) System.out.println(0);
    }
}
